package com.chixing.day04_oop;
/*
    JavaBean:(1)无参构造函数 (2)get,set方法
 */
public class Car {
    private int carId;
    private String carName;
    private String carBrand;
    private String carColor;
    //默认省略 无参构造函数
    public Car(){

    }
    //若已定义有参函数，则会把默认的无参构造函数覆盖,若仍需使用无参构造函数，则需显式的定义出来
    //有参构造函数 alt + insert    constructor  shift+↓
    public Car(int carId, String carName) {
        this.carId = carId;
        this.carName = carName;
    }

    public Car(int carId, String carName, String carBrand, String carColor) {
        this(carId, carName);//调用 其他构造函数
        this.carBrand = carBrand;
        this.carColor = carColor;
    }

    public int getCarId() {
        return carId;
    }

    public void setCarId(int carId) {
        this.carId = carId;
    }

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName;
    }

    public String getCarBrand() {
        return carBrand;
    }

    public void setCarBrand(String carBrand) {
        this.carBrand = carBrand;
    }

    public String getCarColor() {
        return carColor;
    }

    public void setCarColor(String carColor) {
        this.carColor = carColor;
    }
}
